const listBox = document.querySelector('.lists')
const listsbottoms = document.querySelector('.listsbottom')
let lb = 0
getList()
async function getList() {
  const res = await pAjax( {
    url:'/onepuls',
    dataType:'json'
  })
  console.log(res)
  let str = ``
    res.data[lb].productDetailss.forEach( item => {
        str += `
          <li data-id="${ item.id }">
            <div>
              <img src="${item.url}" alt="">
            </div>
            <p>${item.title}</p>
            <ul class="shang">
              <li>${item.activityList[0].activityInfo}</li>
              <li>${item.activityList[0].activityInfo[2]}</li>
            </ul>
            <ul class="xia">
              <li>${item.price}</li>
              <li>${item.originalPrice}</li>
            </ul>
          </li>
        `
    })
    listsbottoms.innerHTML = str
}


$('.listsbottom').on('click','li > div > img',function(){
  window.localStorage.setItem('id',$(this).parents('li').attr('data-id'))
  window.open('./detail.html')
})
$('.listsbottom').on('click','li > .shang',function(){
  window.localStorage.setItem('id',$(this).parents('li').attr('data.productDetailss-id'))
  window.open('./detail.html')
})


